package com.tan.mapper;

import com.tan.po.User;
import com.tan.vo.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.*;
import java.util.Map;

public interface UserMapper {
    //1.输入参数是简单类型
    public void delById(int id);
    //2.输入参数javaBean
    public void insertUser(User user);
    //3.输入参数包装类
    public void insertUserByUserVo(UserVo userVo);
    //4.输入参数多个简单类型
    public void insertUserByParam(String userName,String description);
    //5.输入参数多个简单类型2
    public void insertUserByParam2(@Param("name")String userName,@Param("description")String description);
    //6.输入参数是多个javaBean
    public void insertTwoUser(User user1,User user2);
    //7.输入参数是多个javaBean
    public void insertTwoUser2(@Param("userOne") User user1,@Param("userTwo") User user2);
    //8.输入映射map类型
    public void insertUserMap(Map map);

    //1.输出映射是简单类型：获得数据库记录数
    public int queryTotal();
    //2.输出映射javaBean类型
    public User queryUserById(int id);
    //3.输出映射为resultMap类型
    public User queryUserResultMapById(int id);

    //1.添加记录获得生成的id值
    public void insertUserReturnId(User user);

    //1.动态sqlif 查询用户信息根据用户名和描述信息
    public List<User> queryUsersLikeUserNameAndDescription
    (@Param("userName")String userName,@Param("description")String description);
    //2.动态sql choose when otherwise
    public List<User> queryUserByChooseNameOrDescription
    (@Param("par1") String par1,@Param("par2") String par2);
}
